<template>
	<view class="bannerlist">
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" indicator-active-color="#e8565c">
			<swiper-item v-if="videourl" @click="tapVideo(videourl)">
				<video style="width: 100%;height: 100%;" :src="videourl"></video>
			</swiper-item>
			<swiper-item v-for="(item,index) in bannerList" :key='index' @click="tapBanner(item)">
				<view class="swiper-item">
					<image :src="item.img"></image>
				</view>
			</swiper-item>

		</swiper>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			bannerList: {
				type: Array,
				default: []
			},
			videourl:{
				type:String,
				default:""
			}
		},
		methods: {
             tapBanner(e){
				 this.$emit('tapBanner',e)
			 },
			 tapVideo(e){
				 // uni.previewMedia({
					//  sources:[{
					// 	 type:'video',
					// 	 url:e
					//  }]
				 
				 // })
			 }
		}
	}
</script>

<style lang="scss" scoped>
	.bannerlist {
		>swiper{
			width: 100%;
			height: 350rpx;
		.swiper-item {
			width: 100%;
			height: 350rpx;
			>image{
				width: 100%;
				height: 100%;
			}
		}
		}
	}
</style>
